<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>新增旅游线路</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .form-container {
            max-width: 800px;
            margin: 30px auto;
            padding: 20px;
            background-color: #f8f9fa;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .required-label::after {
            content: "*";
            color: red;
            margin-left: 3px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="form-container">
        <h2 class="mb-4 text-center">新增旅游线路</h2>
        <form action="${pageContext.request.contextPath}/xianlu/add" method="post" enctype="multipart/form-data">
            <%-- 基础信息 --%>
            <div class="row mb-3">
                <div class="col-md-6">
                    <label class="form-label required-label">线路名称</label>
                    <input type="text" class="form-control" name="name" required>
                </div>
                <div class="col-md-6">
                    <label class="form-label required-label">价格(元)</label>
                    <input type="number" class="form-control" name="price" min="1" required>
                </div>
            </div>

            <%-- 地点信息 --%>
            <div class="row mb-3">
                <div class="col-md-6">
                    <label class="form-label required-label">出发地</label>
                    <input type="text" class="form-control" name="chufadi" required>
                </div>
                <div class="col-md-6">
                    <label class="form-label required-label">目的地</label>
                    <input type="text" class="form-control" name="mudidi" required>
                </div>
            </div>

            <%-- 下拉选择 --%>
            <div class="row mb-3">
                <div class="col-md-6">
                    <label class="form-label required-label">所属栏目</label>
                    <select class="form-select" name="lid" required>
                        <option value="">-- 请选择 --</option>
                        <c:forEach items="${list1}" var="lanmu">
                            <option value="${lanmu.lid}">${lanmu.name}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="col-md-6">
                    <label class="form-label required-label">供应商</label>
                    <select class="form-select" name="gongyingshang_name" required>
                        <option value="">-- 请选择 --</option>
                        <c:forEach items="${list2}" var="gys">
                            <option value="${gys.name}">${gys.name}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>

            <%-- 其他信息 --%>
            <div class="row mb-3">
                <div class="col-md-6">
                    <label class="form-label required-label">行程天数</label>
                    <input type="number" class="form-control" name="days" min="1" required>
                </div>
                <div class="col-md-6">
                    <label class="form-label required-label">上传图片</label>
                    <input type="file" class="form-control" name="image" accept="image/*" required>
                </div>
            </div>

            <div class="mb-3">
                <label class="form-label">线路描述</label>
                <textarea class="form-control" name="miaoshu" rows="3"></textarea>
            </div>
                <div class="mb-3">
                    <label class="form-label">是否轮播</label>
                    <select class="form-select" name="lunbo">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </div>



            <div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
                <button type="submit" class="btn btn-primary px-4">提交</button>
                <a href="${pageContext.request.contextPath}/xianlu/list" class="btn btn-outline-secondary">返回列表</a>
            </div>
        </form>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>